﻿@using DualControl.CommonServices
@using DualControl.CycleCheckTasks.Dtos

@model Abp.Application.Services.Dto.ListResultDto<CycleCheckTaskListDto>
@using X.PagedList.Mvc.Core; @*import this so we get our HTML Helper*@
@using X.PagedList; @*import this so we can cast our list to IPagedList (only necessary because ViewBag is dynamic)*@

@inject ICommonService CommonService

@{
    ViewData["Title"] = "排查任务";
}

@section scripts
    {
    <environment names="Development">
        <script src="~/view-resources/Views/CycleCheckTask/Index.js" asp-append-version="true"></script>
    </environment>
    <environment names="Staging,Production">
        <script src="~/view-resources/Views/CycleCheckTask/Index.js" asp-append-version="true"></script>
    </environment>
}
<style>
    .table tbody tr th td {
        vertical-align: middle;
    }
</style>

<div class="row clearfix">
    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
        <div class="card">
            <div class="header">
                <h2>
                    @L("CycleCheckTask")
                </h2>
                <ul class="header-dropdown m-r--5">
                    <li class="dropdown">
                        <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                            <i class="material-icons">more_vert</i>
                        </a>
                        <ul class="dropdown-menu pull-right">
                            <li><a id="RefreshButton" href="javascript:void(0);" class="waves-effect waves-block"><i class="material-icons">refresh</i>@L("Refresh")</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="body table-responsive">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">
                            @L("CycleCheckTask")
                        </h3>
                    </div>

                    <table class="table">
                        <thead>
                            <tr>
                                <th>序号</th>
                                <th>排查人</th>
                                <th>开始时间</th>
                                <th>结束时间</th>
                                <th>上报时间</th>
                                <th>排查周期</th>
                                <th>排查状态</th>
                                <th>排查项目</th>
                                <th>排查人所属部门</th>
                                <td>操作</td>
                            </tr>
                        </thead>
                        <tbody>
                            @{int i = 0; }
                            @foreach (var cyclechecktask in ViewBag.PageOfCycleCheckTaskListDto)
                            {
                                i++;
                                <tr>
                                    <td>@i</td>
                                    <td>@cyclechecktask.Name </td>
                                    <td>@cyclechecktask.StartTime</td>
                                    <td>@cyclechecktask.EndTime</td>
                                    <td>@cyclechecktask.ReportingTime</td>
                                    <td>@cyclechecktask.CheckCycle</td>
                                    <td>@cyclechecktask.CheckState</td>
                                    <td>岗位检查</td>
                                    <td>@cyclechecktask.OuName</td>
                                    <td>
                                        <button class="CycleCheck" data-cyclechecktask-id="@cyclechecktask.Id" data-toggle="modal">立即排查</button>

                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

@Html.PagedListPager((IPagedList)ViewBag.PageOfCycleCheckTaskListDto, page => Url.Action("Index", new { page }))

<div class="modal fade" id="ControlMeasureCreateModal" tabindex="-1" role="dialog" aria-labelledby="HazardSourceCreateModalLabel" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">
                    <span>主要管控措施</span>
                </h4>
            </div>
            <div class="modal-body">
                <form name="controlMeasureCreateForm" role="form" novalidate class="form-validation">
                    <input type="hidden" name="HazardSourceId" id="HazardSourceId" />
                    <input type="hidden" name="RiskPointId" id="RiskPointId" />
                    <input type="hidden" name="OrganizationUnitId" id="OrganizationUnitId" />

                    <div class="tab-content">
                        <div role="tabpanel" class="tab-pane animated fadeIn active" id="create-org-details">
                            <div class="row clearfix" style="margin-top:10px;">
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">管控措施1</label>
                                        <textarea class="form-control" id="controlmeasure1" type="text" name="controlmeasure1" required minlength="3" placeholder="请输入管控措施" autofocus></textarea>

                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">管控措施2</label>
                                        <textarea class="form-control" type="text" name="controlmeasure2" id="controlmeasure2" placeholder="请输入管控措施"></textarea>

                                    </div>
                                </div>

                            </div>

                            <div class="row clearfix" style="margin-top:10px;">
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">管控措施3</label>
                                        <textarea class="form-control" type="text" id="controlmeasure3" name="controlmeasure3" placeholder="请输入管控措施"></textarea>


                                    </div>
                                </div>

                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">管控措施4</label>
                                        <textarea class="form-control" type="text" id="controlmeasure4" name="controlmeasure4" placeholder="请输入管控措施"></textarea>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default waves-effect" data-dismiss="modal">@L("Cancel")</button>
                        <button type="submit" class="btn btn-primary waves-effect">@L("Save")</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="ControlMeasureEditModal" tabindex="-1" role="dialog" aria-labelledby="HazardSourceEditModalLabel" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">
                    <span>编辑管控措施</span>
                </h4>
            </div>
            <div class="modal-body">
                <form name="hazardSourceEditForm" role="form" novalidate class="form-validation">
                    <input type="hidden" name="Id" id="Id" />               <div class="tab-content">
                        <div role="tabpanel" class="tab-pane animated fadeIn active" id="create-org-details">
                            <div class="row clearfix" style="margin-top:10px;">
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">管控措施</label>
                                        <input class="form-control" type="text" id="ControlContent" name="ControlContent" required minlength="3" placeholder="输入管控措施">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default waves-effect" data-dismiss="modal">@L("Cancel")</button>
                        <button type="submit" class="btn btn-primary waves-effect">@L("Save")</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

</div>
